<?php echo $doctype; ?>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<title>LuckyLine</title>
    <meta property="wb:webmaster" content="44de9aea5a865f6d" />
	<meta name="viewport" content="width=640" />
	<?php echo $meta_charset."\n"; ?>
	<?php echo $link."\n"; ?>
	<?php echo $jquery."\n"; ?>
	<script>
	var vpic=0;
	var skey='<?php echo $skey;?>';
	var tkey='<?php echo $tkey;?>';
	var access_token='';
	var uid='';
	var distatus='';
	var k='';
	var l='<?php echo $l;?>';
	
	$(document).ready(function () {
		switch(l){
		case 's':
			slogin();
			break;
		case 't':
			tlogin();
			break;
		}
	});
	
	function save(){
		$.ajax({
			url: '<?php echo base_url(); ?>ewap/save',
			type: 'post',
			dataType: 'text',
			data: 'openid='+uid+'&access_token='+access_token+'&status='+k+'&content='+$('#content').val()+'&pic='+vpic,
			cache: false,
			success: function (text) {
				if(text=='0'){
					$('#content').val('外星人来攻打地球啦！！想要第一时间成为保卫世界的英雄吗？超好评第一人称射击游戏《怪物神枪手》空降中国市场！Lucky line排队活动已经启动！选择角色，加入队列，只要参与就有机会获得游戏手机或其他神秘礼品哦！！还在等什么？神枪手们，戳这里狂热参与吧！');
					goend();
				}else{
					//alert('数据提交失败，请稍后再试!');
					//alert(text.responseText);
				}
			},
			beforeSend: function () {
				if ($('#content').val() == '') {
					alert('请输入内容!');
					$('#content').focus();
					return false;
				}
				if ($('#content').val().length>120) {
					alert('发布内容超过字数限制!');
					$('#content').focus();
					return false;
				}
			},
			error: function (text) {
				//alert(text.responseText);
				//$('#list').html('系统错误');
			}
		});
	}
	
	function slogin(){
		var t=true;
		var cookie=getCookie('di');
		if(cookie!=null&& cookie!=''){
			access_token=cookie.split('_')[1];
			uid=cookie.split('_')[0];
			distatus=cookie.split('_')[2];
			k='sina';
			
			if(distatus!='s') {t=false;}
		}else{
			t=false;
		}
		
		if(t){
			$('#index').hide();
			$('#pubs').show();
			showcount();
		}else{
			location='https://api.weibo.com/oauth2/authorize?client_id='+skey+'&redirect_uri=<?php echo base_url(); ?>index.php?c=ewap&m=index&response_type=code&display=mobile&po=s';
		}
	}
	
	function tlogin(){
		var t=true;
		var cookie=getCookie('di');
		if(cookie!=null&& cookie!=''){
			access_token=cookie.split('_')[1];
			uid=cookie.split('_')[0];
			distatus=cookie.split('_')[2];
			k='tencent';
			$('#index').hide();
			$('#pubs').show();
			
			if(distatus!='t') {t=false;}
		}else{
			t=false;
		}
		
		if(t){
			$('#index').hide();
			$('#pubs').show();
			showcount();
		}else{
			location='http://openapi.qzone.qq.com/oauth/show?which=ConfirmPage&display=mobile&response_type=code&client_id=' + tkey + '&redirect_uri=<?php echo urlencode(base_url(). 'index.php?c=ewap&m=index&po=t')?>&scope=get_user_info,add_share,list_album,upload_pic,check_page_fans,add_t,add_pic_t,del_t,get_repost_list,get_info,get_other_info,get_fanslist,get_idolist,add_idol,del_idol,add_one_blog,add_topic,get_tenpay_addr';
		}
	}
	
	function getCookie(a) {
	    var b = document.cookie.match(new RegExp(a + "=([^;]*)"));
	    return b != null ? unescape(b[1]) : null
	}
	
	function showcount(){
		$.ajax({
			url: '<?php echo base_url(); ?>/ewap/countnum',
			type: 'post',
			dataType: 'text',
			cache: false,
			success: function (text) {
				$('#countnum').html(parseInt(text)+1);
			},
			error: function (text) {
				//alert(text.responseText);
				//$('#list').html('系统错误');
			}
		});
	}
	
	function sel(vals){
		for(var i=0;i<4;i++){
			$('#p'+i).attr('src','/images/ewap/e_point1.png');
		}
		
		$('#p'+vals).attr('src','/images/ewap/e_point2.png');
		
		vpic=vals;
	}
	function goback(){
		$('#pubs').hide();
		$('#end').hide();
		$('#index').show();
	}
	function goend(){
		$('#pubs').hide();
		$('#index').hide();
		$('#end').show();
	}
	</script>
</head>
<body>
	<div class="wapbox">
		<div id="index">
			<div class="itop">
				<img src="/images/ewap/e_itoppic.jpg" width="605" height="312" border="0" />
			</div>
			<div class="itxt">
				<div class="tp">
					<div class="bp">
						<ul>
							<li><img src="/images/ewap/e_itxt1.png" width="86" height="18" border="0"></li>
							<li class="txt" style="text-indent:2em;font-size:24px;line-height:30px;font-size:24px;">点击“参与”，通过微博账号登录活动页面，发布微博分享即可入选神枪手的队列！ 发布成功后，你就可以看见你自己的发布内容出现在时间轴上哦~。活动结束，将从所有参与活动的神枪手当中抽取被选中的救世主，并送给他们包括极品游戏神器、游戏货币、精选装备在内的神秘奖品。</li>
							<li><img src="/images/ewap/e_itxt2.png" width="87" height="18" border="0"></li>
							<li class="txt">
								<ul>
									<li><img src="/images/tuhao.png" wifth="170" height="170" border="0"><br>即刻秒杀你之土豪金</li>
									<li><img src="/images/moqi.png" wifth="170" height="170" border="0"><br>游戏神杀利器之摩奇手机</li>
									<li><img src="/images/jinzhuan.png" wifth="170" height="170" border="0"><br>一秒钟变土豪之金砖豪华包</li>
									<li><img src="/images/qian.png" wifth="170" height="170" border="0"><br>永远不差钱之怪物币豪华包</li>
									<li><img src="/images/xiaojinzhuan.png" wifth="170" height="170" border="0"><br>分分秒变小康之金砖大礼盒</li>
								</ul>
							</li>
						</ul>
						<div style="clear:both;"></div>
					</div>
				</div>
			</div>
			<div class="ibt">
				<ul>
					<li><img src="/images/ewap/e_itbt.gif" width="194" height="45" border="0" style="cursor:pointer;" onclick="tlogin();" /></li>
					<li><img src="/images/ewap/e_iqbt.gif" width="194" height="45" border="0" style="cursor:pointer;" onclick="slogin();" /></li>
				</ul>
			</div>
			<div class="imovie">
				<iframe src="http://fast.wistia.net/embed/iframe/q3eyutmomn" allowtransparency="true" frameborder="0" scrolling="no" class="wistia_embed" name="wistia_embed" allowfullscreen mozallowfullscreen webkitallowfullscreen oallowfullscreen msallowfullscreen width="600" height="345"></iframe>
			</div>
		</div>
		
		<div id="pubs" style="display:none">
			<div class="ptop">
				<div>
				<ul>
					<li><img src="/images/pic0-1.png" width="100" height="100" border="0" onclick="sel('0');"></li>
					<li align="center"><img src="/images/ewap/e_point2.png" width="35" height="36" border="0" id="p0"></li>
				</ul>
				<ul>
					<li><img src="/images/pic1-1.png" width="100" height="100" border="0" onclick="sel('1');"></li>
					<li align="center"><img src="/images/ewap/e_point1.png" width="35" height="36" border="0" id="p1"></li>
				</ul>
				<ul>
					<li><img src="/images/pic2-1.png" width="100" height="100" border="0" onclick="sel('2');"></li>
					<li align="center"><img src="/images/ewap/e_point1.png" width="35" height="36" border="0" id="p2"></li>
				</ul>
				<ul>
					<li><img src="/images/pic3-1.png" width="100" height="100" border="0" onclick="sel('3');"></li>
					<li align="center"><img src="/images/ewap/e_point1.png" width="35" height="36" border="0" id="p3"></li>
				</ul>
			</div>
			</div>
			<div class="pcount">你排在第 <span id="countnum"></span> 位</div>
			<div class="pinput">
				<textarea id="content" name="content" name="">外星人来攻打地球啦！！想要第一时间成为保卫世界的英雄吗？超好评第一人称射击游戏《怪物神枪手》空降中国市场！Lucky line排队活动已经启动！选择角色，加入队列，只要参与就有机会获得游戏手机或其他神秘礼品哦！！还在等什么？神枪手们，戳这里狂热参与吧！</textarea>
			</div>
			<div class="pbt">
				<ul>
					<li><img src="/images/ewap/e_pubbt.gif" width="258" height="81" border="0" onclick="save();"></li>
					<li><img src="/images/ewap/e_pubcancelbt.gif" width="258" height="81" border="0" onclick="$('#index').show();$('#pubs').hide();"></li>
				</ul>
			</div>
		</div>
		
		<div id="end" style="display:none">
			<div>
				<img src="/images/ewap/e_pendtop.gif" width="640" height="440" border="0">
			</div>
			<div>
				<img src="/images/ewap/e_pendtxt.gif" width="640" height="117" border="0">
			</div>
			<div class="ebt">
				<img src="/images/ewap/e_pendbt.gif" width="464" height="161" border="0" onclick="goback();">
			</div>
		</div>
	</div>
</body>
</html>

